/*
 * @Author: zhuxiaoyi
 * @Date: 2023-05-11 15:23:03
 * @LastEditor: zhuxiaoyi
 * @LastEditTime: 2024-07-05 23:10:06
 * @Description:
 */
import { createWebHistory, createRouter, RouteRecordRaw } from "vue-router";
const routes: Array<RouteRecordRaw> = [
  {
    path: "/login",
    name: "Login",
    meta: {
      title: "登录",
      keepAlive: true,
      requireAuth: false,
    },
    component: () => import("@/views/login/login.vue"),
  },
  {
    path: "/index",
    name: "index",
    meta: {
      title: "首页",
      keepAlive: true,
      requireAuth: true,
    },
    redirect: "index/general",
    component: () => import("@/views/index/index.vue"),
    children: [
      {
        path: "general",
        name: "general",
        meta: {
          title: "算法管理通用配置",
          keepAlive: true,
          requireAuth: true,
        },
        component: () => import("@/views/index/general/general.vue"),
        children: [
          {
            path: "randerManage",
            name: "randerManage",
            meta: {
              title: "渲染文件管理",
              keepAlive: true,
              requireAuth: true,
            },
            component: () =>
              import("@/views/index/general/randerManage/randerManage.vue"),
            children: [
              {
                path: "randerList",
                name: "randerList",
                meta: {
                  title: "渲染文件注册",
                  keepAlive: true,
                  requireAuth: true,
                },
                component: () =>
                  import(
                    "@/views/index/general/randerManage/randerList/randerList.vue"
                  ),
                children: [],
              },
              {
                path: "randerBinding",
                name: "randerBinding",
                meta: {
                  title: "渲染文件绑定",
                  keepAlive: true,
                  requireAuth: true,
                },
                component: () =>
                  import(
                    "@/views/index/general/randerManage/randerBinding/randerBinding.vue"
                  ),
                children: [],
              },
            ],
          },
          {
            path: "algorithmManage",
            name: "algorithmManage",
            meta: {
              title: "算法注册管理",
              keepAlive: true,
              requireAuth: true,
            },
            component: () =>
              import(
                "@/views/index/general/algorithmManage/algorithmManage.vue"
              ),
            children: [
              {
                path: "algorithmType",
                name: "algorithmType",
                meta: {
                  title: "算法类型管理",
                  keepAlive: true,
                  requireAuth: true,
                },
                component: () =>
                  import(
                    "@/views/index/general/algorithmManage/algorithmType/algorithmType.vue"
                  ),
                children: [],
              },
              {
                path: "algorithmList",
                name: "algorithmList",
                meta: {
                  title: "通用算法列表",
                  keepAlive: true,
                  requireAuth: true,
                },
                component: () =>
                  import(
                    "@/views/index/general/algorithmManage/algorithmList/algorithmList.vue"
                  ),
                children: [],
              },
            ],
          },
          {
            path: "processManage",
            name: "processManage",
            meta: {
              title: "算法流程管理",
              keepAlive: true,
              requireAuth: true,
            },
            component: () =>
              import("@/views/index/general/processManage/processManage.vue"),
            children: [
              {
                path: "processList",
                name: "processList",
                meta: {
                  title: "算法流程列表",
                  keepAlive: true,
                  requireAuth: true,
                },
                component: () =>
                  import(
                    "@/views/index/general/processManage/processList/processList.vue"
                  ),
                children: [],
              },
              {
                path: "processGraph/:id",
                name: "processGraph",
                meta: {
                  title: "算法流程管理",
                  keepAlive: true,
                  requireAuth: true,
                },
                component: () =>
                  import(
                    "@/views/index/general/processManage/processGraph/processGraph.vue"
                  ),
                children: [],
              },
              {
                path: "executeGraph/:id",
                name: "executeGraph",
                meta: {
                  title: "算法流程执行",
                  keepAlive: true,
                  requireAuth: true,
                },
                component: () =>
                  import(
                    "@/views/index/general/processManage/executeGraph/executeGraph.vue"
                  ),
                children: [],
              },
            ],
          },
          {
            path: "executeManage",
            name: "executeManage",
            meta: {
              title: "任务管理",
              keepAlive: true,
              requireAuth: true,
            },
            component: () =>
              import("@/views/index/general/executeManage/executeManage.vue"),
            children: [
              {
                path: "executeList",
                name: "executeList",
                meta: {
                  title: "任务列表",
                  keepAlive: true,
                  requireAuth: true,
                },
                component: () =>
                  import(
                    "@/views/index/general/executeManage/executeList/executeList.vue"
                  ),
                children: [],
              },
              {
                path: "previewLayers",
                name: "previewLayers",
                meta: {
                  title: "成果预览",
                  keepAlive: true,
                  requireAuth: true,
                },
                component: () =>
                  import(
                    "@/views/index/general/executeManage/previewLayers/previewLayers.vue"
                  ),
                children: [],
              },
            ],
          },
        ],
      },
      {
        path: "custom",
        name: "custom",
        meta: {
          title: "业务定制化展示",
          keepAlive: true,
          requireAuth: true,
        },
        component: () => import("@/views/index/custom/custom.vue"),
        children: [
          {
            path: "taskManage",
            name: "taskManage",
            meta: {
              title: "任务管理",
              keepAlive: true,
              requireAuth: true,
            },
            component: () =>
              import("@/views/index/custom/taskManage/taskManage.vue"),
            children: [
              {
                path: "taskList",
                name: "taskList",
                meta: {
                  title: "任务列表",
                  keepAlive: true,
                  requireAuth: true,
                },
                component: () =>
                  import(
                    "@/views/index/custom/taskManage/taskList/taskList.vue"
                  ),
                children: [],
              },
            ],
          },
          {
            path: "resultManage",
            name: "resultManage",
            meta: {
              title: "成果管理",
              keepAlive: true,
              requireAuth: true,
            },
            component: () =>
              import("@/views/index/custom/resultManage/resultManage.vue"),
            children: [
              {
                path: "resultShow",
                name: "resultShow",
                meta: {
                  title: "成果展示",
                  keepAlive: true,
                  requireAuth: true,
                },
                component: () =>
                  import(
                    "@/views/index/custom/resultManage/resultShow/resultShow.vue"
                  ),
                children: [],
              },
            ],
          },
        ],
      },
      {
        path: "userManage",
        name: "userManage",
        meta: {
          title: "用户管理",
          keepAlive: true,
          requireAuth: true,
        },
        component: () => import("@/views/index/userManage/userManage.vue"),
      }
    ],
  },
  {
    path: "/custom/:id",
    name: "custom",
    meta: {
      title: "成果展示",
      keepAlive: true,
      requireAuth: false,
    },
    component: () => import("@/views/custom/custom.vue"),
  },
  {
    path: "/bigScreen/:id",
    name: "bigScreen",
    meta: {
      title: "可视化平台",
      keepAlive: true,
      requireAuth: false,
    },
    component: () => import("@/views/custom/bigScreen.vue"),
  },
  {
    path: "/",
    redirect: "/bigScreen/11",
    meta: {
      title: "",
    },
  },
  {
    path: "/404",
    name: "404",
    component: () => import("@/views/notfound/notfound.vue"),
  },
  {
    path: "/:catchAll(.*)",
    redirect: "/404",
  },
];

const router = createRouter({
  history: createWebHistory(),
  routes,
});

export default router;
